﻿//
// Created: 2018/8/30
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.Admin;

namespace  Model.Admin.Map
{
    internal  class AdvertisementMap:EntityTypeConfiguration< Advertisement >    
    {
        public AdvertisementMap()
        {
             this.ToTable("Advertisement");
             this.HasKey(i => new { i.ID });
             this.Property(i => i.ID).HasColumnName("ID");                     
             this.Property(i => i.AdName).HasColumnName("AdName");                     
             this.Property(i => i.AdType).HasColumnName("AdType");                     
             this.Property(i => i.AdSource).HasColumnName("AdSource");                     
             this.Property(i => i.AdPicUrl).HasColumnName("AdPicUrl");
            this.Property(i => i.AdDomain).HasColumnName("AdDomain");
            this.Property(i => i.AdLink).HasColumnName("AdLink");                     
             this.Property(i => i.IsShow).HasColumnName("IsShow");                     
             this.Property(i => i.SortId).HasColumnName("SortId");                     
             this.Property(i => i.Remarks).HasColumnName("Remarks");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.KeyWord).HasColumnName("KeyWord");                     
             this.Property(i => i.Site).HasColumnName("Site");                     
             this.Property(i => i.DeadTime).HasColumnName("DeadTime");                     
             this.Property(i => i.Enable).HasColumnName("Enable");
             
            
        }   
    }
    
     public static class AdvertisementMapExtensions
    {
        public static void UserAdvertisementMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new AdvertisementMap());
        }
    }
}